/********************************************************************
 
 Copyright (C), 2012年 dhc. All rights reserved.
 
 Filename: 	    MailDetailMessage.h 
 
 Author:        muzongcun
 
 Version:       1.0
 
 Description:   MailDetailMessage
 
 History:
 
 muzongcun    2012/3/10     1.0     Create
 
 *********************************************************************/
#import <UIKit/UIKit.h>
#import "MailListCell.h"
#import "ToolDrawerView.h"
#import "UserTask.h"
#import "TKLoadingAnimationView.h"
@interface MailDetailMessage : UIViewController <UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,UITextViewDelegate,UIWebViewDelegate,UserTaskDelegate>
{
	UITableView *        m_mainView;
	UINavigationBar *    m_navBar;                 //来自xib文件,最好自己创建
    UIButton*            m_attachBut;              //打开附件button
    UIButton*            m_attachNameBut;          //附件的名字
    UIWebView *          m_contentWebView;
    
    UILabel *            m_contentLabel;  
    UILabel *            m_sendLabel;              //发件人
    UILabel *            m_dateLabel;              //发送人日期
	UILabel *            m_subjectLabel;           //发件标题
    
    UIView *             m_butContainerView;       //存放button的view
	UIView *             m_toContainerView;        //收件人
    UIView *             m_dateContainerView;      //日期
	UIView *             m_contentContainerView;   //内容
	UIView *             m_subjectContainerView;   //主题
   
	NSTimer     *        m_tipTimer;
	UIAlertView *        m_tipAlert;
	NSMutableArray *     m_toArray;                //保存发送邮件列表所有receiverid
	NSDictionary *       m_receiverObj;  
	BOOL                 m_offsetFlag;
	CGRect               m_rect;
    int                  m_boxType;               //箱体类型
    int                  m_rowIndex;              //保存当前行的索引。
    NSString*            m_mailShareID;           //保存当前的shareid
    NSString*            m_mailID;                //保存当前的mailid
    ToolDrawerView*      m_toolDrawerView;        //弹出菜单
    NSMutableDictionary* m_mailDetailInfo;        //mail详细信息
    NSMutableDictionary* m_mailListInfo;          //从maillist取得信息 
    UIButton*            m_floatMenuNextBut;      //弹出菜单上的下一个按钮
    UIButton*            m_floatMenuPriorBut;     //弹出菜单上的前一个按钮
    UIButton*            m_barPriorBut;           //前一个按钮
    UIButton*            m_barNextBut;            //下一个按钮
    BOOL                 m_bThreadFresh;          //是否是线程刷新数据
    BOOL                 m_bNextPriorDetail;      //点击next prior 按钮
    NSCondition *        m_condition;             //线程同步
    volatile  BOOL       m_bIsBack;               //是否单击了返回按钮
    TKLoadingAnimationView*     m_spinner;        //菊花转动
    UIButton*            m_barRetBut;             //返回按钮
    UIButton*            m_barRevertBut;
    UIButton*            m_barMergeBut;           //归并按钮
    UIButton*            m_barOperateBut;
}
@property (nonatomic) CGRect                    m_rect;
@property (nonatomic, retain) UILabel *         m_sendLabel;         //发件人
@property (nonatomic, retain) UILabel *         m_subjectLabel;      //发件标题
@property (nonatomic, retain) UILabel *         m_contentLabel; 
@property (nonatomic, retain) UILabel *         m_dateLabel;         //发送人日期
@property (nonatomic, retain) UIWebView *       m_contentWebView; 
@property (nonatomic, retain) MailList*         m_mailList;
@property (nonatomic, retain) UINavigationBar*  m_navBar;
@property (nonatomic, retain) NSMutableDictionary* m_mailDetailInfo;
@property (nonatomic, retain) NSMutableDictionary* m_mailListInfo;  

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil receiverObj:(NSDictionary*) rec;

-(void) dismissTipAlert:(NSTimer*) ti;

/*
 保存当前行的id和索引
 */
-(void) SetMailShareID:(NSString*) strShareID mailID:(NSString*)strMailID rowIndex:(int)rowIndex boxType:(int)boxType;

//去掉 < > 提取邮件地址
-(NSString*) getMailAddress:(NSString*) originMailAddr;
//-----------弹出菜单----------------

-(void) onReturn;   //返回前一个界面
-(void) onDelete;   //删除
-(void) onRevert;   //回复
-(void) onMerge;    //归并
-(void) onTransmit; //转发
-(void) onImportant;//重要
-(void) onPrior;    //上一个
-(void) onNext;     //下一个
-(void) onHide;     //取消
//-(void) onAttach;   //添加附件
-(void)refreshData;
-(void)cancelData;
@end
